package com.esunrising.esungsc.controller;

import com.esunrising.esungsc.entity.TApiXm;
import com.esunrising.esungsc.service.CustomItemsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@ResponseBody
@Api(value = "/internal/api/v1/CustomItems" , tags = {"核算项目字典"})
@RequestMapping("/internal/api/v1/CustomItems")
@Slf4j
public class CustomItemsController {
    @Autowired
    private CustomItemsService customItemsService;

    @GetMapping("/CustomItemsResult")
    public Object getCustomItemsResult(){

        String date = "2021-01-01 00:00:00";
        String enddate = "2022-01-01 00:00:00";
        String hszzid = "0105052903";
        String year = "2024";

        //记录日志的参数
        String dwbh = "";
        String orgCode = "";

        List<TApiXm> tApiXmList = customItemsService.getCustomItemsResult(date,enddate,hszzid,year,dwbh,orgCode);

        //存数据
        customItemsService.saveCustomItemsResult(tApiXmList);
        return tApiXmList;
    }
}
